package com.test.testcases;


import com.test.base.InitAppium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import java.util.List;

import static java.lang.Thread.sleep;

/**
 * appium java demo
 * Created by xuedonglei on 2017/4/27.
 */
public class AppiumTestCaseDemo extends InitAppium {


    @org.testng.annotations.Test
    public void addContact() {
        WebElement el = driver.findElement(By.id("btn_email_login"));
        el.click();
        List<WebElement> textFieldsList = driver.findElementsByClassName("android.widget.EditText");
        textFieldsList.get(0).sendKeys("chen@qq.com");
        textFieldsList.get(1).sendKeys("123456");
        driver.hideKeyboard();
        WebElement login = driver.findElement(By.id("login_btn_login"));
        login.click();
        System.out.println("Testcase Sucessful!");
    }
}

